package Preson;

import BookListPackage.BookList;
import FunctionPackage.*;

import java.util.Scanner;

public class Manager extends Person{

    Function[] functions = new Function[] { new Exit(),
            new Search(),
            new Add(),
            new Remove(),
            new Display()};
    public Manager(String name) {
        super(name);
    }

    @Override
    public int mun() {

        System.out.println("-------欢迎来到图书---------");
        System.out.println("-------1.查找图书 ----------");
        System.out.println("-------2.新增图书 ----------");
        System.out.println("-------3.删除图书 ----------");
        System.out.println("-------4.显示图书 ----------");
        System.out.println("-------0.退出系统 ----------");
        System.out.println("请输入你的操作：");
        Scanner scanner = new Scanner(System.in);
        return scanner.nextInt();
    }

    @Override
    public void operate(int choice, BookList bookList) {
        functions[choice].work(bookList);
    }
}
